import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
export function randomString(len) {
  　　len = len || 32
  　　var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
  　　var maxPos = $chars.length
  　　var pwd = ''
  　　for (var i = 0; i <= len; i++) {
  　　　　pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
  　　}
  　　return pwd
  }